<template>
    <!-- [3,6].includes(pay_method)&&receipt_method!=5 -->
    <!-- [4,8].includes(pay_method) -->
    <div class="saveUpdate">
        <el-dialog :close-on-click-modal="false" title="查看二维码" :visible.sync="showUpdate" @close="$emit('update:showDialog', false)" width="800px" :showDialog="showDialog">
            <el-form :model="infoModel" ref="saveChn" label-width="120px" size="mini">
                <dialog-wrapper :MaxWidth="800">
                    <div>
                        <!-- 二维码 -->
                        <div v-if="[3,6].includes(infoModel.pay_method)&&infoModel.receipt_method!=5">
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="充值方式:">
                                        <span>{{payType[infoModel.pay_method]}}</span>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="收款方式:">
                                        <span>{{RecepiptMethodType[infoModel.receipt_method]}}</span>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                            <el-row>
                                <el-col>
                                    <img :src="$store.state.app.qiniuUrl+infoModel.qr_code" />
                                </el-col>
                            </el-row>
                        </div>
                        <div v-for="(item, index) in infoModel.quotas" :key="index" >
                        <div v-if="[4,8].includes(infoModel.pay_method)">
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="充值方式:">
                                        <span>{{payType[infoModel.pay_method]}}</span>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="收款方式:">
                                        <span>{{RecepiptMethodType[infoModel.receipt_method]}}</span>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="支付金额:">
                                        <span>{{item.amount}}</span>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="到账金额:">
                                        <span>{{item.real_amount}}</span>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                            <el-row>
                                <el-col>
                                    <img :src="$store.state.app.qiniuUrl+item.qr_code" />
                                </el-col>
                            </el-row>
                        </div>
                        </div>
                    </div>
                </dialog-wrapper>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="$emit('update:showDialog', false)" size="small">取 消</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
import DialogWrapper from '@/components/DialogWrapper'
export default {
    components: { DialogWrapper },
    data() {
        return {
            showUpdate: this.showDialog,
            RecepiptMethodType: this.$store.state.app.RecepiptMethodType,
            payType: this.$store.state.app.payType,
        }
    },
    props: {
        infoModel: { type: Object },
        showDialog: { type: Boolean }
    },
    methods: {

    },
    watch: {
        showDialog() {
            this.showUpdate = this.showDialog
        }
    }
}
</script>
